﻿Imports System.Data.SqlClient

Public Class CDataProvider
    'Public Shared datasource As String = "Data Source=ALEXBLACK-PC;"
    Public Shared database As String = "QLTV"
    'Public Shared username = " udi=sa;"
    'Public Shared pwd = "pwd=123;"
    'Public Shared security = "integrated security=true;"

    Public Shared connectonString1 As String = "Data Source=ALEXBLACK\SQLEXPRESS; Database=QLTV; integrated security = true;"
    Public Shared connectonString As String = "Data Source=ALEXBLACK-PC; Database=QLTV; uid=sa; pwd=123"
    Public Shared Function Connect() As SqlConnection
        Dim con As SqlConnection = New SqlConnection(connectonString)

        Try
            con.Open()
        Catch ex As Exception
            con = New SqlConnection(connectonString1)
            con.Open()
        End Try
        Return con
    End Function

   End Class
